var cc__decorate = __decorate;
Object.defineProperty(exports, "__esModule", {
  value: true
});
var cc__decorator = cc._decorator;
var ccp_ccclass = cc__decorator.ccclass;
var ccp_property = cc__decorator.property;
var ccp_menu = cc__decorator.menu;
var def_ComBreathe = /* */function (_cc$Component6) {
  function _ctor() {
    var _this12;
    babel_classCallCheck(this, _ctor);
    _this12 = _callSuper(this, _ctor, arguments);
    _this12.speed = .5;
    _this12.around = .9;
    _this12.initAround = 1;
    _this12.dirX = 1;
    _this12.dirY = 1;
    return _this12;
  }
  babel_inherits(_ctor, _cc$Component6);
  return babel_createClass(_ctor, [{
    key: "onEnable",
    value: function onEnable() {
      if (this.node) {
        this.node.scale = this.initAround;
        cc.tween(this.node).to(this.speed, {
          scaleX: this.around * this.dirX,
          scaleY: this.around * this.dirY
        }, {
          easing: "sineInOut"
        }).to(this.speed, {
          scaleX: this.initAround * this.dirX,
          scaleY: this.initAround * this.dirY
        }, {
          easing: "sineInOut"
        }).union().repeatForever().start();
      }
    }
  }, {
    key: "startBreath",
    value: function startBreath() {
      if (this.node) {
        this.node.scale = this.initAround;
        cc.tween(this.node).to(this.speed, {
          scaleX: this.around * this.dirX,
          scaleY: this.around * this.dirY
        }, {
          easing: "sineInOut"
        }).to(this.speed, {
          scaleX: this.initAround * this.dirX,
          scaleY: this.initAround * this.dirY
        }, {
          easing: "sineInOut"
        }).union().repeatForever().start();
      }
    }
  }, {
    key: "stopBreath",
    value: function stopBreath() {
      this.node && cc.Tween.stopAllByTarget(this.node);
    }
  }]);
}(cc.Component);
cc__decorate([ccp_property({
  tooltip: "呼吸速度"
})], def_ComBreathe.prototype, "speed", undefined);
cc__decorate([ccp_property({
  tooltip: "呼吸程度"
})], def_ComBreathe.prototype, "around", undefined);
cc__decorate([ccp_property({
  tooltip: "初始程度"
})], def_ComBreathe.prototype, "initAround", undefined);
cc__decorate([ccp_property({
  tooltip: "方向X"
})], def_ComBreathe.prototype, "dirX", undefined);
cc__decorate([ccp_property({
  tooltip: "方向Y"
})], def_ComBreathe.prototype, "dirY", undefined);
def_ComBreathe = cc__decorate([ccp_ccclass, ccp_menu("v-lez/ComBreathe")], def_ComBreathe);
exports.default = def_ComBreathe;